#pragma once
#include <string>
#include <chrono>
#include <iomanip>
#include <sstream>

#include "WsfScenarioExtension.hpp"
#include "UtCallbackHolder.hpp"
#include "json/json.h"
class ObserverControlInterface
{
public:
    ObserverControlInterface();
    ~ObserverControlInterface() {};

public:
    struct InterfaceError
    {
        int errorCode;
        std::string errorInfo;
        InterfaceError(int errorCode, const std::string &info) : errorCode(errorCode), errorInfo(info) {}
    };

    // 处理外部来的消息
    InterfaceError DecodeMsg(std::string msg);
    InterfaceError HandleMsg_Start(Json::Value &data);
    InterfaceError HandleMsg_Pause(Json::Value &data);
    InterfaceError HandleMsg_Resume(Json::Value &data);
    InterfaceError HandleMsg_Complete(Json::Value &data);

    // 移动
    InterfaceError HandleMsg_LocationChange(Json::Value &data);
    InterfaceError HandleMsg_MoveTo(Json::Value &data);
    InterfaceError HandleMsg_Speed(Json::Value &data);

    // 仿真
    InterfaceError HandleMsg_SimClockRate(Json::Value &data);
    InterfaceError HandleMsg_SimAdvanceTime(Json::Value &data);

    // 组件
    InterfaceError HandleMsg_AttackTarget(Json::Value &data);
    InterfaceError HandleMsg_ControlSensor(Json::Value &data);
};
